define(['knockout', 'store', 'util'], function (ko, Store, Util) {
    function ViewModel(params) {
        Util.extend(this, params);

        var scope = this;

        //scope.contentCmp = ko.observable('cmp:Empty');
        //ko.root.secondCmp = scope.contentCmp;
        var menuStore = new Store({
            // initWith:[
            //     {name: '用户管理', href: '/SystemManage/UserCard', icon: 'user'},
            //     {name: '部门管理', href: '/SystemManage/DepartmentCard', icon: 'building'},
            //     {name: '角色管理', href: '/SystemManage/RoleCard', icon: 'userlock'},
            //     {name: '菜单管理', href: '/SystemManage/MenuCard', icon: 'columns'},
            //     {name: '字典管理', href: '/SystemManage/DictCard', icon: 'columns'},
            //     {name: '分类管理', href: '/SystemManage/ClassifyCard', icon: 'columns'}
            // ]
            initWith:ko.root.menus.findSubItemsByParentField({value:Util.getLocationHash(1),name:'href',pName:'fatherId'})
        });

        scope.leftCard = {
            css:{'xgx-col1-left-card':true},
            cardBody: {
                name: 'cmp:List',
                params: {
                    displayField: 'name',
                    showOperation: false,
                    store: menuStore,
                    onItemSelected: function (item) {
                        //ko.root.secondCmp({name:'cmp:' + Util.firstCharacterU(item.name()) + 'Card'});
                    },
                    onNoneItemSelected: function () {
                        //ko.root.secondCmp({name:'cmp:Empty'});
                    }
                }
            }
        };
    }

    return ViewModel;
});
